Internet Protocol version 6 (IPv6)-based communication environment has newly been introduced into the Internet that has started from Internet Protocol version 4 (IPv4)-based communication environment. The current Internet is in the process of introducing the IPv6 protocol. For this reason, in the process of introduction, a plurality of types of communication devices such as communication devices that only support IPv4, communication devices in which a part of a function corresponding to IPv6 is implemented in addition to a function corresponding to current IPv4, and communication devices in which a function corresponding to IPv6 is completely implemented, and all functions corresponding to IPv4 and IPv6 are usable are present.
FIG. 15 is an explanatory diagram when name resolution is performed in an IPv4-based communication environment. FIG. 15 illustrates that two entries of IPv4 addresses p and q whose record type is “A” are registered to a domain name system (DNS) server with respect to a host name “hostX.” When a packet of designating a record type “A” of IPv4 and querying an address of the host name “hostX” is transmitted from a client terminal to the DNS server, the DNS server searches for an entry including an IPv4 address corresponding to “hostX.” Then, the DNS server transmits a packet including the searched IPv4 address to the client terminal. In the example illustrated in FIG. 15, the DNS server transmits the packet including the addresses p and q as the IPv4 address of “hostX” to the client terminal. Hereinafter, a packet of designating a host name and a record type and querying an address corresponding to the host name is referred to as a “DNS query packet.”
Meanwhile, in order to introduce a new function of IPv6 into an environment in which a plurality of types of communication devices described above are present, various requirements need to be satisfied. First, in the currently operating existing environment, a problem in which it is difficult to perform communication should not be caused. Further, when both information of IPv4 and information of IPv6 are present, information of new IPv6 may be selected as a priority.
There have been proposed various kinds of methods of performing name resolution in a mixed communication environment of IPv4 and IPv6. FIG. 16 is an explanatory diagram illustrating an example of information stored in a DNS server in a mixed communication environment of IPv4 and IPv6. Hereinafter, a record type of an IPv6 address is referred to as “AAAA,” and a record type of an IPv4 address is referred to as “A.” FIG. 16 illustrates that a total of four entries, that is, two entries of IPv4 addresses p and q whose record type is “A” and two entries of IPv6 addresses s and t whose record type is “AAAA” are registered to a DNS (domain name system) server with respect to a host name “hostX.” Hereinafter, when name resolution is performed in a mixed communication environment of IPv4 and IPv6, the DNS server is assumed to store information illustrated in FIG. 16.
Here, an application programming interface (API) used by a device (for example, a client terminal) that queries an address in a DNS will be described. A resolver library which is a set of low-class APIs performing primitive processing is used for a name resolution process in a DNS. Specifically, in a DNS, a command (for example, nslookup, dig, or host) performing low-class processing of directly extracting data stored in a database included in a server side is included in the resolver library.
Meanwhile, a communication application used in a user land usually uses a high-class API without directly calling the resolver library. The resolver library is used inside the high-class API, but the user needs not be aware of an API in the inside.
Specifically, gethostbyname( ) is used as a high-class API in an IPv4-only communication environment. However, with the appearance of IPv6, gethostbyname( ) corresponding to the IPv4-only communication environment is not used, and getaddrinfo( ) is currently used. getaddrinfo( ) is a function corresponding to protocols (multi-protocol) of both IPv4 and IPv6. In the getaddrinfo( ) function, a record type (specifically, an address family representing the type of a network address) is designated, and a query is performed. As the address family, any one of IPv4(PF_INET), IPv6(PF_INET6), and either-is-okay (PF_UNSPEC) is designated. The query result (address) will be returned in the form of a list.
At the application side of the user land, a query is expected to be performed without regard to a record type. However, at the DNS server side, it is necessary to manage both addresses of IPv4 and IPv6. Thus, ultimately, the client side is assumed to perform a query in which PF_UNSPEC is designated as the address family in a state in which the DNS server manages both addresses of IPv4 and IPv6.
Specifically, in the high-class API, a communication application (designating, for example, PF_UNSPEC) is generated without being aware of a record type. Meanwhile, when the high-class API calls the resolver library, the resolver library designates a record type for name resolution and queries the DNS server about an address. It is because an address and a record type are necessary when the DNS server searches for an entry.
FIGS. 17 to 21 are explanatory diagrams illustrating an operation of querying a DNS server about an address in a mixed communication environment of IPv4 and IPv6. Hereinafter, an entry including an IPv4 address is referred to as an “A record,” and an entry including an IPv6 address is referred to as an “AAAA record.”
A method illustrated in FIG. 17 is a method of first querying a DNS server about an A record corresponding to a host name and then querying an AAAA record after a response is received (that is, after being on standby until a response is received). In the method illustrated in FIG. 17, first, a client transmits a DNS query packet by which a host name “hostX” and a record type “A” are designated to a DNS server. Then, the DNS server searches for corresponding IPv4 addresses p and q, and transmits a packet including the searched addresses to the client. Next, the client that has received the packet including the IPv4 addresses transmits a DNS query packet by which a host name “hostX” and a record type “AAAA” are designated to the DNS server. Then, the DNS server searches for corresponding IPv6 addresses s and t, and transmits a packet including the searched addresses to the client.
A method illustrated in FIG. 18 is a method of first querying a DNS server about an A record corresponding to a host name and determining whether or not to query an AAAA record depending on received response content. In other words, the method illustrated in FIG. 18 is different from the method illustrated in FIG. 17 in that it is determined whether or not to query the AAAA record depending on response content of the IPv4 addresses p and q. In the method illustrated in FIG. 18, first, the client transmits a DNS query packet by which a host name “hostX” and a record type “A” are designated to a DNS server. Then, the DNS server searches for corresponding IPv4 addresses p and q, and transmits a packet including the searched addresses to the client. The client that has received the packet including the IPv4 addresses determines whether or not to transmit a DNS query packet by which a host name “hostX” and a record type “AAAA” are designated to the DNS server depending on content included in the packet. Here, when it is determined that the DNS query packet is to be transmitted to the DNS server, a subsequent process is the same as in the method illustrated in FIG. 17.
A method illustrated in FIG. 19 is a method of first querying a DNS server about an A record corresponding to a host name and then querying an AAAA record without waiting for a response. In the method illustrated in FIG. 19, first, a client transmits a DNS query packet by which a host name “hostX” and a record type “A” are designated to a DNS server. Then, the client transmits a DNS query packet by which a host name “hostX” and a record type “AAAA” are designated to the DNS server before receiving a packet including an IPv4 address. Here, content of the packet to be transmitted from the DNS server to the client according to the received DNS query packet is the same as the content illustrated in FIG. 17.
A method illustrated in FIG. 20 is a method of first querying a DNS server about an AAAA record corresponding to a host name and then querying an A record after a response is received. In other words, the method illustrated in FIG. 20 is different from the method illustrated in FIG. 17 in that sequences of querying the A record and the AAAA record are reversed. Specifically, first, a client transmits a DNS query packet by which a host name “hostX” and a record type “AAAA” are designated to a DNS server. Then, the DNS server searches for corresponding IPv6 addresses s and t, and transmits a packet including the searched addresses to the client. Next, the client that has received the packet including the IPv6 addresses transmits a DNS query packet by which a host name “hostX” and a record type “A” are designated to the DNS server. Then, the DNS server searches for corresponding IPv4 addresses p and q, and transmits a packet including the searched addresses to the client.
A method illustrated in FIG. 21 is a method of first querying a DNS server about an AAAA record corresponding to a host name and then querying an A record without waiting for a response. In the method illustrated in FIG. 21, first, a client transmits a DNS query packet by which a host name “hostX” and a record type “AAAA” are designated to a DNS server. Then, the client transmits a DNS query packet by which a host name “hostX” and a record type “A” are designated to the DNS server before receiving a packet including an IPv6 address. Here, content of the packet to be transmitted from the DNS server to the client according to the received DNS query packet is the same as the content illustrated in FIG. 20.
As described above, when the DNS server stores both entries of the IPv4 address and the IPv6 address corresponding to the host name, the client transmits the DNS query packet by which the host name and the record type of the IPv4 address are designated and the DNS query packet by which the host name and the record type of the IPv6 address are designated, respectively. As a result, the client can acquire both of the IPv4 address and the IPv6 address corresponding to the host name.
A communication device that performs name resolution in an environment in which both an IPv4 address and an IPv6 address are present is discussed in Patent Literature 1. The communication device discussed in Patent Literature 1 first requests a DNS server, which performs name resolution in an IPv4 address space, to perform name resolution. When an IPv4 address has not been obtained, the communication device requests a DNS proxy server, which queries a DNS server performing name resolution in an IPv6 address space, to perform name resolution again.